﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ByBikeShop.Administracao.MasterPage
{
  public partial class Admin : System.Web.UI.MasterPage
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      try
      {

      }
      catch (Exception ex)
      {
        if (ex.Message.Contains("shadow copy"))
          Response.Redirect(Request.RawUrl);

        else if (ex.Message.Contains("inner exception"))
          if (ex.InnerException.Message.Contains("inner exception"))
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "a", "alert('" + ex.InnerException.InnerException.Message + ");", true);
          else
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "a", "alert('" + ex.InnerException.Message + ");", true);
        else
          ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "a", "alert('" + ex.Message + ");", true);
      }
    }
  }
}